import { useUrlQueryParam } from "hooks";
import { useMemo } from "react";

export const useProjectsSearchParams = () => {
  const [param, setParam] = useUrlQueryParam(["name", "personId"]);
  const newParam = useMemo(() => {
    return { ...param, personId: Number(param.personId) || undefined };
  }, [param]);

  return [newParam, setParam] as const;
};
